<#include "../common/header.ftl"/>

<script>
    $(function () {
        // 时间插件
        laydate.render({
            elem: '#time' //指定元素
        });
        // 修改推荐
        $(".content").click(function () {
            // 发送ajax请求获取商品详情的内容
            var content = $(this).data("content");
            if (content) {
                $("#showContentModal .modal-body").html(content);

            }
            $("#showContentModal").modal("show");
        });


    });
</script>

</head>
<body>

<!--图片上传表单-->
<#include "../common/img.ftl"/>

<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl"/>
    <div class="row">
        <div class="col-sm-3">
        <#-- 往数据模型中填充一个属性 -->
            <#assign menu="ask"/>
            <#include "../common/menu.ftl"/>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">骡友提问管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/ask/list.do" method="post">
                <!--高级查询--->
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label for="keyword">关键字:</label>
                    <input type="text" class="form-control" id="keyword" name="keyword" value="${(qo.keyword)!}"
                           placeholder="请输入标题/内容">
                </div>
                <input type="submit" id="btn_query" class="btn btn-default" value="查询">
                <div class="form-group">
                    <label>问题类型:</label>
                    <select class="form-control" name="type" id="type">
                        <option value="-1">全部</option>
                        <option value="0">默认问题</option>
                        <option value="1">攻略问题</option>
                        <option value="2">无聊的问题</option>
                    </select>
                    <script>
                        $("#type").val(${(qo.type)!});
                    </script>
                </div>

            </form>

            <table class="table table-striped table-hover">
                <tr>
                    <th>编号</th>
                    <th>标题</th>
                    <th>提问者</th>
                    <th>内容</th>
                    <th>问题发布时间</th>
                    <th>提问类型</th>
                    <th>操作</th>
                </tr>

            <#-- 循环迭代指令 -->
                <#list pageInfo.list as entity>
                    <tr>
                        <td>${entity_index + 1}</td>
                        <td>${entity.title}</td>
                        <td>${entity.user.nickName}</td>
                        <td><a class="btn btn-info btn-xs content" data-content='${entity.content}'>
                            <span class="glyphicon glyphicon-warning-sign"></span> 查看内容
                        </a></td>
                        <td>${entity.askTime?string("yyyy-MM-dd HH:mm:ss")}</td>
                        <td>${entity.typeName}</td>
                        <td>
                            <a class="btn btn-danger btn-xs deleteBtn" data-id='${entity.id}'>
                                <span class="glyphicon glyphicon-warning-sign"></span> 删除
                            </a>
                        </td>
                    </tr>
                </#list>
            </table>
            <#include "../common/page.ftl"/>
        </div>
    </div>
</div>


<div class="modal fade" id="showContentModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">内容详情</h4>
            </div>
            <div class="modal-body">
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
<style>
    #showContentModal img {
        width: 100%;
    }
</style>
</body>
</html>